import styled from 'styled-components'
import { FC } from 'react'

type PropsType = {
  bgColor?: string
  fontColor?: string
  title?: string
}

const Wrapper = styled.div`
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: ${(props: PropsType) => props.bgColor || '#007bff'};
  color: ${(props: PropsType) => props.fontColor || '#fff'};
  z-index: 9;
`

const Header: FC<PropsType> = (props) => {
  return <Wrapper {...props}>{props.title || 'Header 组件'}</Wrapper>
}

export default Header
